<!--
  @author yangjiangming
  @date 2018-12-10 20:40:28
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html th:replace="~{work/modify/common/layout :: layout('备注', ~{::title}, ~{::content}, ~{::script})}"
      xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <title>工单管理-算账</title>
</head>
<body>

<div class="content" th:fragment="content">
    <style>
        .account-result-table td:last-child {
            text-align: right;
        }
        .tpl-input-spe {
            width: 95%;
            height: 100%;
            background: none;
            border: 1px solid #eee;
            padding-left: 5px;
            box-sizing: border-box;
        }
    </style>
    <form action="" class="layui-form">
        <input type="text" hidden name="orderId" th:value="${accountVo.orderId}">
        <input type="text" hidden name="workId" th:value="${accountVo.workId}">
        <input type="text" hidden name="plat" th:value="1"/>

        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label d-nopaddinglr d-label-56">算账明细</label>
            <div class="layui-input-inline">
                <div id="account-result">
                    <div class="layui-form-mid layui-word-aux">点击保存进行算账</div>
                </div>
            </div>
        </div>
        <div class="layui-form-item" th:if="${accountVo.type != 3}">
            <label class="layui-form-label">补贴奖励:</label>
            <div class="layui-input-block subsidy" style="margin-right: 40px">
                <table class="layui-table" id="masteraccount-subsidy" lay-filter="masteraccount-subsidy"></table>
            </div>
        </div>

        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label d-nopaddinglr d-label-56">备注</label>
            <div class="layui-input-inline d-marginleft-10" style="width:800px">
                <textarea placeholder="请输入内容,最多1000字" lay-verify="length" name="operatorRemark"
                          class="layui-textarea"></textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline" style="margin-left: 110px;">
                <button th:if="${accountVo.tryErpAccount == 2}" class="layui-btn" lay-submit lay-filter="savedata" data-try="yes">预算账</button>
                <button class="layui-btn layui-btn-normal" lay-submit lay-filter="savedata">保存</button>
            </div>
        </div>
    </form>

</div>

<script type="text/x-template" id="account-result-template">
    <table class="layui-table account-result-table">
        <colgroup>
            <col width="150">
            <col width="200">
            <col align="right">
        </colgroup>
        <thead>
            <tr>
                <th></th>
                <th>结算项目</th>
                <th>结算金额</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td rowspan="4"></td>
                <td>订单服务费</td>
                <td>{{ result.serviceProviderRetention | fenToYuan }}</td>
            </tr>
            <tr>
                <td>保险费</td>
                <td>{{ result.insurance | toMinus | fenToYuan }}</td>
            </tr>
            <tr>
                <td>保险互助金</td>
                <td>{{ result.helpEach | toMinus | fenToYuan }}</td>
            </tr>
            <tr>
                <td>质保金</td>
                <td>{{ result.deposit | toMinus | fenToYuan }}</td>
            </tr>
            <tr>
                <td>优惠券分摊</td>
                <td>服务商分摊金额</td>
                <td>{{ result.voucherShare | toMinus | fenToYuan }}</td>
            </tr>
            <tr>
                <td>优惠减免及分摊</td>
                <td>服务商分摊金额</td>
                <td>{{ result.discountShare | toMinus | fenToYuan }}</td>
            </tr>
            <tr>
                <td>积分抵扣及分摊</td>
                <td>服务商分摊金额</td>
                <td>{{ result.integralShare | toMinus | fenToYuan }}</td>
            </tr>
        </tbody>
        <tfoot style="font-weight: 700">
            <tr>
                <td>提成金额</td>
                <td></td>
                <td>{{ result.commissionAmount | fenToYuan }}</td>
            </tr>
        </tfoot>
    </table>
</script>

<!--特殊补贴-->
<script type="text/html" id="specialBenefit">
    <input class="tpl-input-spe specialBenefit" type="text"  name="specialBenefit" autocomplete="off" placeholder="请输入">
</script>
<!--春节补贴-->
<script type="text/html" id="springSubsidyRate">
    <p>{{d.springSubsidyRate}}%</p>
</script>

<script th:replace="work/modify/yeyx/_template :: templates"/>

<script th:inline="javascript">
	var accountVo = [[${accountVo}]];
	var layuiModel = {
        oms_work_modify_remark: "work/modify/zmn.oms.work.modify.yeyx.account"
    };
</script>
</body>
</html>